package liuyu_test2;
import java.io.*;
import java.text.DecimalFormat;
public class Phonebill {
    public static int testweek(int Year,int Month,int Day) {//利用公式判断某年某月某日为星期几
        /*int iweek = 0;
        int y=0,m=0,d=0;
        if(Month == 1 || Month == 2) {
            y = Year -1;
            m=Month+12;
            d=Day;
        }
        iweek=(d + 2*m + 3*(m+1)/5 + y + y/4 - y/100 + y/400)%7+1;

        return iweek;
    }*/
        int iweek = 0;
        int y=0,c=0,m=0,d=0;

        if(Month == 1 || Month == 2) {
                c=(Year-1)/100;
            y=(Year-1)%100;
            m=Month+12;
            d=Day;
        }

        else {
                c=Year/100;
            y=Year%100;
            m=Month;
            d=Day;
        }

        iweek=y+y/4+c/4-2*c+26*(m+1)/10+d-1;
        iweek=iweek>=0?(iweek%7):(iweek%7+7);
        if(iweek == 0) {
                iweek=7;
        }
        return iweek;
    }
    //判断日期是否为特殊时间段，并对通话时间进行处理(开始时间大于结束时间)
    public static int testdate1(int Month,int Day) {

        if(Month==3 && Day >7 && Day <= 14 ) {
            return  1;
        }
        else
            return  0;
}
    public static int testdate2(int Month,int Day) {
        if (Month == 11 && Day <= 7)
            return 1;
        else
            return 0;

    }

}
